package com.niguang.work.labour.api.controller;


import com.niguang.work.labour.api.entity.AdminBankInfo;
import com.niguang.work.labour.api.service.AdminBankInfoService;
import com.niguang.work.labour.common.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 83673
 * @since 2018-11-29
 */
@RestController
@RequestMapping("/adminBankInfo")
public class AdminBankInfoController {

    @Autowired
    AdminBankInfoService adminLaborUserService;

    @PostMapping("/addBankInfo")
    public Result addBankInfo(@Valid AdminBankInfo adminBankInfo) {

        return adminLaborUserService.addBankInfo(adminBankInfo);
    }

    @PostMapping("/addBankPic")
    public Result addBankPic(MultipartFile file, String key) {

        return adminLaborUserService.addBankPic(file, key);
    }

    @PostMapping("/getBankPic")
    public Result getBankPic(String key) {

        return adminLaborUserService.getBankPic(key);
    }

    @PostMapping("/modifyBankInfo")
    public Result modifyBankInfo(@Valid AdminBankInfo adminBankInfo) {

        return adminLaborUserService.modifyBankInfo(adminBankInfo);
    }

    @PostMapping("/getBankInfo")
    public Result getBankInfo(String id) {
        return adminLaborUserService.getBankInfo(id);

    }


}

